"use client";
/**
* Standalone SSO/SCIM admin route (TASK-0131 / TASK-0132).
*
* The spec: `apps/web/components/admin/SsoTabs.tsx` "wired into the org
* admin Integrations tab (route works standalone)." TASK-0133 will host
* `SsoTabs` + `ScimCard` inside the `/org/[orgId]/admin/` console (8 tabs).
* Until then THIS standalone route exposes the SSO + SCIM surfaces on its
* own: a minimal session-gated shell, addressed by org id.
*
* `/org/[orgId]/admin/integrations` → +
*
* The components are org-owner gated server-side (the API 403s a
* non-owner), so the route simply rendering them is safe — the data layer
* enforces authorization.
*/
import { useEffect } from "react";
import { useParams, useRouter } from "next/navigation";
import Link from "next/link";
import { ShieldCheck } from "lucide-react";
import { useAuth } from "@/hooks/use-auth";
import { SsoTabs } from "@/components/admin/SsoTabs";
import { ScimCard } from "@/components/admin/ScimCard";
export default function SsoAdminIntegrationsPage() {
const { orgId } = useParams<{ orgId: string }>();
const router = useRouter();
const { user, initializing } = useAuth();
useEffect(() => {
if (!initializing && !user) {
const next = window.location.pathname + window.location.search;
router.replace(`/login?next=${encodeURIComponent(next)}`);
}
}, [initializing, user, router]);
if (initializing || !user) {
return (
);
}
return (
{orgId ? (
<>
>
) : (
Missing org id.
)}
);
}